import { createRequest } from '/@/api/service';
const module = 'ib/flowpath/v1/FlowpathDraftApi/';
/**
 * 保存审批流程草稿
 */
function SAVE(
  data: FlowPathDraftApi.FlowpathDraftSaveReq,
  header: object = {},
): Promise<FlowPathDraftApi.FlowpathDraftSaveResp> {
  return createRequest(`${process.env.APP_API_URL}${module}save`, data, header, 'POST');
}

/**
 * 查询流程审批草稿
 */
function FIND_ONE(
  data: FlowPathDraftApi.FlowpathDraftReq,
  header: object = {},
): Promise<FlowPathDraftApi.FlowpathDraftResp> {
  return createRequest(`${process.env.APP_API_URL}${module}findOne`, data, header, 'POST');
}

/**
 * 删除草稿
 */
function DELETE(
  data: FlowPathDraftApi.FlowpathDraftReq,
  header: object = {},
): Promise<FlowPathDraftApi.FlowpathDraftResp> {
  return createRequest(`${process.env.APP_API_URL}${module}delete`, data, header, 'POST');
}

export { SAVE, FIND_ONE, DELETE };
